﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TPOJ.Web.ViewModel.CompareRecord>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%if (Model != null)
   { %>
   <%=Html.Encode(Model.UserAName) %> vs <%=Html.Encode(Model.UserBName) %>
    <%}
   else
   { %>
   Compare Users
    <%} %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <% using (Html.BeginForm()) { %>
           Compare<%=Html.TextBox("userA") %>and<%=Html.TextBox("userB") %><input type="submit" value="Go" />
    <% } %>

    <p />
   <% if (Model != null)
      { %>
      <table>
        <tr>
            <th>Problems only <%= Html.ActionLink(Model.UserAName, "Details", "Account", new { id = Model.UserAName }, new { target = "_blank" })%> accepted</th>
        </tr>
        <% foreach (var item in Model.ProblemsACedOnlyByA) { %>
            <tr>
                <td><%= Html.ActionLink(item.ToString(), "Details", "Problem", new { id = item }, new { target = "_blank" })%></td>
            </tr>
        <%} %>
        <tr>
            <th>Problems only <%= Html.ActionLink(Model.UserBName, "Details", "Account", new { id = Model.UserBName }, new { target = "_blank" })%> accepted</th>
        </tr>
        <% foreach (var item in Model.ProblemsACedOnlyByB) { %>
            <tr>
                <td><%= Html.ActionLink(item.ToString(), "Details", "Problem", new { id = item }, new { target = "_blank" })%></td>
            </tr>
        <%} %>
        <tr>
            <th>Problems both <%= Html.ActionLink(Model.UserAName, "Details", "Account", new { id = Model.UserAName }, new { target = "_blank" })%> and <%= Html.ActionLink(Model.UserBName, "Details", "Account", new { id = Model.UserBName }, new { target = "_blank" })%> accepted</th>
        </tr>
        <% foreach (var item in Model.ProblemsACedBoth) { %>
            <tr>
                <td><%= Html.ActionLink(item.ToString(), "Details", "Problem", new { id = item }, new { target = "_blank" })%></td>
            </tr>
        <%} %>

        <tr>
            <th>Problems only <%= Html.ActionLink(Model.UserAName, "Details", "Account", new { id = Model.UserAName }, new { target = "_blank" })%> tried but failed</th>
        </tr>
        <% foreach (var item in Model.ProblemsTriedOnlyByA) { %>
            <tr>
                <td><%= Html.ActionLink(item.ToString(), "Details", "Problem", new { id = item }, new { target = "_blank" })%></td>
            </tr>
        <%} %>
        <tr>
            <th>Problems only <%= Html.ActionLink(Model.UserBName, "Details", "Account", new { id = Model.UserBName }, new { target = "_blank" })%> tried but failed</th>
        </tr>
        <% foreach (var item in Model.ProblemsTriedOnlyByB) { %>
            <tr>
                <td><%= Html.ActionLink(item.ToString(), "Details", "Problem", new { id = item }, new { target = "_blank" })%></td>
            </tr>
        <%} %>
        <tr>
            <th>Problems both <%= Html.ActionLink(Model.UserAName, "Details", "Account", new { id = Model.UserAName }, new { target = "_blank" })%> and <%= Html.ActionLink(Model.UserBName, "Details", "Account", new { id = Model.UserBName }, new { target = "_blank" })%> tried but failed</th>
        </tr>
        <% foreach (var item in Model.ProblemsTriedBoth) { %>
            <tr>
                <td><%= Html.ActionLink(item.ToString(), "Details", "Problem", new { id = item }, new { target = "_blank" })%></td>
            </tr>
        <%} %>
      </table>
      
   <%} %>
</asp:Content>

